function convertstyletoinfo(datastyle,divClass,btns){
	var divstyle = {}
	if(JSON.stringify(divClass) != '{}'){
		divstyle['name'] = divClass.className
		var styleBlock = []
		var divBlocks = divClass.divBlocks
		var colNames = []
		datastyle.forEach((val)=>{
			colNames.push(val.name)
		})
		divBlocks.forEach((val)=>{
			var colN = val.colNames
			colNames = colNames.filter(x => !colN.includes(x))
		})
		
		if(colNames.length>0){
			var block = {}
			block['blockName'] = 'list_invisible'
			block['colNames'] = colNames
			block['description'] = ''
			block['property'] = ''
			divBlocks.push(block)
		}
		
		for(var n=0; n<divBlocks.length;n++){
			if(divBlocks[n].blockName == "list_client_billno_status" || divBlocks[n].blockName == "list_name1_name2" || divBlocks[n].blockName == "list_name1_billno1_status"){
				var blockTemp = {}
				blockTemp['name'] = divBlocks[n].blockName
				var content = []
				for(var o=0; o<divBlocks[n].colNames.length; o++){
					for(var m=0; m<datastyle.length; m++){
						if(datastyle[m].name == divBlocks[n].colNames[o]){
							content.push(datastyle[m])
							break
						}
					}
				}
				blockTemp['content'] = content
				styleBlock.push(blockTemp)
			}else if(divBlocks[n].blockName == "list_line1_nosplit" 
					|| divBlocks[n].blockName == "list_line1_col2_nosplit"
					|| divBlocks[n].blockName == "list_col1_notitle"
					|| divBlocks[n].blockName == "list_col2_notitle"){
				var blockTemp = {}
				blockTemp['name'] = divBlocks[n].blockName
				var content = []
				for(var o=0; o<divBlocks[n].colNames.length; o++){
					for(var m=0; m<datastyle.length; m++){
						if(datastyle[m].name == divBlocks[n].colNames[o]){
							content.push(datastyle[m])
							break
						}
					}
				}
				blockTemp['content'] = content
				styleBlock.push(blockTemp)
				
			}else if(divBlocks[n].blockName == "list_invisible"){
				var blockTemp = {}
				blockTemp['name'] = divBlocks[n].blockName
				var content = []
				for(var o=0; o<divBlocks[n].colNames.length; o++){
					for(var m=0; m<datastyle.length; m++){
						if(datastyle[m].name == divBlocks[n].colNames[o]){
							content.push(datastyle[m])
							break
						}
					}
				}
				blockTemp['content'] = content
				styleBlock.push(blockTemp)
				
			}else if(divBlocks[n].blockName == "list_creater"){
				var blockTemp = {}
				blockTemp['name'] = divBlocks[n].blockName
				var content = []
				for(var o=0; o<divBlocks[n].colNames.length; o++){
					for(var m=0; m<datastyle.length; m++){
						if(datastyle[m].name == divBlocks[n].colNames[o]){
							content.push(datastyle[m])
							break
						}
					}
				}
				blockTemp['content'] = content
				styleBlock.push(blockTemp)
			}else if(divBlocks[n].blockName == "list_memo1"){
				var blockTemp = {}
				blockTemp['name'] = divBlocks[n].blockName
				var content = []
				for(var o=0; o<divBlocks[n].colNames.length; o++){
					for(var m=0; m<datastyle.length; m++){
						if(datastyle[m].name == divBlocks[n].colNames[o]){
							content.push(datastyle[m])
							break
						}
					}
				}
				blockTemp['content'] = content
				styleBlock.push(blockTemp)
			}else if(divBlocks[n].blockName == "list_col1_btns"){
				var blockTemp = {}
				blockTemp['name'] = divBlocks[n].blockName
				var content = []
				for(var o=0; o<divBlocks[n].colNames.length; o++){
					for(var m=0; m<datastyle.length; m++){
						if(datastyle[m].name == divBlocks[n].colNames[o]){
							content.push(datastyle[m])
							break
						}
					}
					btns.forEach((val)=>{
						if(val.name == divBlocks[n].colNames[o]){
							content.push(val)
						}
					})
				}
				blockTemp['content'] = content
				styleBlock.push(blockTemp)
			}
		}
		divstyle['styleBlock'] = styleBlock
	}
	return divstyle;
}

function constructheadlist(colstyle){
	var headerList = []
	var headersearchcontent = []
	var headerinputcontent = []
	var headerscancontent = []
	var headerpopcontent = []
	for(var j=0;j<colstyle.length;j++){
		if(colstyle[j].style.position == "headersearch" && colstyle[j].style.colVisible){
			colstyle[j].style['name'] = colstyle[j].name 
			colstyle[j].style['optype'] = 'radio'
			headersearchcontent.push(colstyle[j].style)
		}
		if(colstyle[j].style.position == "headerinputbar" && colstyle[j].style.colVisible){
			colstyle[j].style['name'] = colstyle[j].name
			headerinputcontent.push(colstyle[j].style)
		}
		if(colstyle[j].style.position == "headerscanbar" && colstyle[j].style.colVisible){
			colstyle[j].style['name'] = colstyle[j].name
			headerscancontent.push(colstyle[j].style)
		}
		if(colstyle[j].style.position == "popsearch" && colstyle[j].style.colVisible){
			if(colstyle[j].style.editStyle == 'dddw' && colstyle[j].style.dddw.name=='d_nvo_uipage_dwc'){
				var DataObjectExtData = uni.getStorageSync('DataObjectExtData')
				var tag_dddwName = colstyle[j].style.tag_dddwName
				var customlist = []
				for(var i=0; i<DataObjectExtData.length;i++){
					if(DataObjectExtData[i].dataobjectname == tag_dddwName){
						customlist.push(DataObjectExtData[i])
					}
				}
				colstyle[j].style['codeTable'] = customlist
				if(colstyle[j].style.colValue!='' && colstyle[j].style.colValue!=undefined){
					let pval = colstyle[j].style.colValue
					let dataColumn = colstyle[j].style.dddw.dataColumn
					let displayColumn = colstyle[j].style.dddw.displayColumn
					customlist.forEach((cusval,cusindex)=>{
						if(pval == cusval[dataColumn]){
							colstyle[j].style['value'] = cusindex
							colstyle[j].style['coldisplay'] = cusval[displayColumn]
						}
					})
				}
			}
			colstyle[j].style['name'] = colstyle[j].name
			headerpopcontent.push(colstyle[j].style)
		}
	}
	var headersearch = {}
	headersearch['content'] = []
	
	// if(JSON.stringify(headersearchcontent) != '[]'){
		headersearch['styletype'] = 'headersearch'
		if(JSON.stringify(headersearchcontent) != '[]'){
			for(var k=0;k<headersearchcontent.length;k++){
				headersearch.content.push(headersearchcontent[k])
			}
		}
		if(JSON.stringify(headerpopcontent) != '[]'){
			var headerpop = {}
			headerpop['colname'] = 'search'
			let i18n = uni.getStorageSync('i18n')
			if(i18n === 'en' ){
				headerpop['colValue'] =  "Conditional filtering"
			}else{
				headerpop['colValue'] =  "条件筛选"
			}
			
			headerpop['optype'] =  "dropdown"
			headerpop['layercontent'] = headerpopcontent
			headersearch.content.push(headerpop)
		// }
		headerList.push(headersearch)
		
	}
	
	if(JSON.stringify(headerinputcontent) != '[]'){
		var headerinput = {}
		headerinput['styletype'] = 'headerinput'
		headerinput['content'] = headerinputcontent
		headerList.push(headerinput)
	}
	if(JSON.stringify(headerscancontent) != '[]'){
		var headerscan = {}
		headerscan['styletype'] = 'headerscan'
		headerscan['content'] = headerscancontent
		headerList.push(headerscan)
	}
	return headerList
}

function post2(url, data = {}) {
  return new Promise(function (resolve, reject) {
    wx.request({
      method: "POST",
      url: url,
      data: data,
	  header: {'content-type': 'application/x-www-form-urlencoded'},
      success(res) {
		  if(res.rtn == -1){
			  uni.showToast({
			  	title:res.message,
				duration:2000
			  })
		  }
		resolve(res);
      },
      fail(err) {
        reject(err)
      }
    })
  })
}

function getcommitobj(div,datalist,olddatalist){
	var commitobj = {}
	commitobj['divArea'] =div.divArea
	commitobj['dataObject'] = div.style.dataObject
	var dataArr = []
	
	datalist.forEach((val,index)=>{
		var dataobj = {}
		var conditions = {}
		var type = ''
		var log = {}
		var data = {}
		var type = val.opttype
		var olditem = []
		if(type === 'update'){
			var temarr = []
			val.data.forEach((val3, index3)=>{
				if(val3.style.key){
					conditions[val3.name] = val3.style.value
					var temobj = {}
					temobj['index'] = index3
					temobj['value'] = val3.style.value
					temarr.push(temobj)
				}
			})
			olddatalist.forEach((val,index)=>{
				var count = 0
				temarr.forEach((valarr,indexarr)=>{
					if(val.data[valarr.index].style.value === valarr.value){
						count += 1
					}
				})
				if(count === temarr.length){
					olditem = val.data
				}
			})
		}
		
		
		val.data.forEach((val2,index2)=>{
			if(type === 'delete'){
				if(val2.style.key){
					conditions[val2.name] = val2.style.value
				}
				
			}else if(type === 'update'){
				if(val2.style.ismodified){
					data[val2.name] = val2.style.value
					var obj = {}
					obj['nValue'] = val2.style.value
					obj['oValue'] = olditem[index2].style.value
					obj['title'] = val2.name
					log[val2.name] = obj
				}
				
			}else if(type === 'insert'){
				data[val2.name] = val2.style.value
				var obj = {}
				obj['nValue'] = val2.style.value
				obj['title'] = val2.name
				log[val2.name] = obj
			}
		})
		if(type != '' && type != undefined){
			dataobj['row'] = index
			dataobj['type'] = type
			dataobj['data'] = data
			dataobj['log'] = log
			dataobj['conditions'] = conditions
			dataArr.push(dataobj)
		}
	})
	commitobj['dataArr'] = dataArr
 	return commitobj
	
}

function getcommitobj2(div, datalist2, olddatalist2){
	var commitobj = {}
	commitobj['divArea'] =div.divArea
	commitobj['dataObject'] = div.style.dataObject
	var dataArr = []
	try{
	datalist2.forEach((datalist, listindex) => {
		var type = datalist[0].opttype
		if(JSON.stringify(datalist) == JSON.stringify(olddatalist2[listindex]) && type!='delete' && type!='insert') return
		var dataobj = {}
		var conditions = {}
		var type = ''
		var log = {}
		var data = {}
		var olditem = []
		datalist.forEach((val,index)=>{
			type = val.opttype
			if(type === 'update' || type === 'delete'){
				val.data.forEach((val3, index3)=>{
					if(val3.style.key){
						if(val3.style.value!=''){
							conditions[val3.name] = val3.style.value
						}
					}
				})
			}
			
			val.data.forEach((val2,index2)=>{
				if(type === 'update'){
					if(val2.style.ismodified){
						if(val2.style.tag_isNotEmpty && (val2.style.colValue==='' || val2.style.colValue===undefined || val2.style.colValue===null)){
							throw Error('请输入'+ val2.style.colText)
							return
						}
						data[val2.name] = val2.style.colValue
						var obj = {}
						obj['nValue'] = val2.style.colValue
						obj['oValue'] = olddatalist2[listindex][index].data[index2].style.colValue
						obj['title'] = val2.name
						log[val2.name] = obj
					}
					
				}else if(type === 'insert'){
					if(val2.style.tag_isNotEmpty && (val2.style.colValue===undefined || val2.style.colValue==='' || val2.style.colValue===null)) {
						throw Error('请输入'+val2.style.colText )
					}
					if(val2.style.ismodified){
						data[val2.name] = val2.style.colValue
						var obj = {}
						obj['nValue'] = val2.style.colValue
						obj['title'] = val2.name
						log[val2.name] = obj
						}
					}
			})
		})
		if((type != '' && type != undefined && JSON.stringify(data) != '{}') || (type == 'delete'&&JSON.stringify(conditions)!='{}')){
			dataobj['row'] = listindex
			dataobj['type'] = type
			dataobj['data'] = data
			dataobj['log'] = log
			dataobj['conditions'] = conditions
			dataArr.push(dataobj)
		}
	})
	commitobj['dataArr'] = dataArr
		return commitobj
	}catch(e){
		throw Error(e.message)
	}
}

function calculateExpression(str) {
    // 运算符栈
    const operators = [];
    // 操作数栈
    const values = [];
    // 定义运算符的优先级
    const precedence = {
        '+': 1,
        '-': 1,
        '*': 2,
        '/': 2
    };

    /**
     * 辅助函数，用于执行运算
     * @param {*} operators 运算符栈
     * @param {*} values 操作数栈
     */
    function applyOperator(operators, values) {
        const operator = operators.pop();
        const b = values.pop();
        const a = values.pop();

        switch (operator) {
            case '+':
                values.push(a + b);
                break;
            case '-':
                values.push(a - b);
                break;
            case '*':
                values.push(a * b);
                break;
            case '/':
                values.push(a / b);
                break;
            default:
                console.log('出错啦');
                break;
        }
    }

    for (let i = 0; i < str.length; i++) {
        const char = str[i];

        // 如果是数字，解析整个数字
        if (!isNaN(char)) {
            let num = parseFloat(char);

            while (i + 1 < str.length && !isNaN(str[i + 1])) {
                num = num * 10 + parseFloat(str[i + 1]);
                i++;
            }

            values.push(num);
        } else if (char === '(') {
            // 如果是左括号，将其推入运算符栈
            operators.push(char);
        } else if (char === ')') {
            // 如果是右括号，将栈顶运算符应用于运算数，直到遇到左括号为止
            while (
                operators.length > 0 &&
                operators[operators.length - 1] !== '('
            ) applyOperator(operators, values);

            // 弹出左括号
            operators.pop();
        } else if (char in precedence) {
            // 如果是运算符
            while (
                operators.length > 0 &&
                precedence[char] <= precedence[operators[operators.length - 1]]
            ) applyOperator(operators, values);

            operators.push(char);
        }
    }

    // 处理剩余的运算符
    while (operators.length > 0) applyOperator(operators, values);

    // 最终结果位于操作数栈的顶部
    return values[0];
}

function strtoexp(strpre){
	var h = strpre
	h = h.replace('(', ' ( ').replace('+', ' + ').replace('-', ' - ').replace('/', ' / ').replace('*', ' * ').replace(')', ' ) ')
	var harr = h.split(' ')
	var e = ``
	harr.forEach((val)=>{
		if(val === '') return
		if(val === '+' || val === '-' ||val === '*' ||val === '/' ||val === '(' ||val === ')'){
			e += `${val}`
		}else{
			if(val === 'a'){
				e += `${a}`
			}else if(val === 'b') {
				e += `${b}`
			}else if(val === 'd') {
				e += `${d}`
			}
		}
	})
	return e
}

function divblocktrans(divBlocks,datastyle){
	var divblock = {}
	var blockstyle = []
	if(JSON.stringify(divBlocks) != '[]' && divBlocks != undefined ){
		divBlocks.forEach((val, index) => {
			var block = []
			if(val.colNames != undefined){
				val.colNames.forEach((val2, index2) => {
					datastyle.forEach((val3, index3) => {
						if(val2 == val3.name){
							var item = datastyle[index3]
							datastyle.splice(index3, 1)
							block.push(item)
						}
					})
				})
			}
			divblock['blockName'] = val.blockName
			divblock['style'] = block
			divblock['property'] = val.property
			blockstyle.push(JSON.parse(JSON.stringify(divblock)) )
		})
	}
	if(JSON.stringify(datastyle) != '[]'){
		divblock['blockName'] = ''
		divblock['style'] = datastyle
		divblock['property'] = ''
		blockstyle.push(JSON.parse(JSON.stringify(divblock)))
	}
	return blockstyle
}

async function billaddinitaldatastyle(datastyle,util,options,divArea,that){
	
	var DataObjectExtData = uni.getStorageSync('DataObjectExtData')
	console.log('billaddinitaldatastyle',JSON.parse(JSON.stringify(datastyle)))
	for(var k=0;k<datastyle.length;k++){
		var customlist = []
		if(datastyle[k].style.editStyle=='editmask' && datastyle[k].style.colType=='datetime'){
			datastyle[k].style['starts'] = '1990-01-01'
			datastyle[k].style['ends'] = '2100-01-01'
			datastyle[k].style['placeholder'] = '请选择'
			var date = new Date()
			var time = util.formatTime2(date)
			datastyle[k].style['value'] = time
			datastyle[k].style['coldisplay'] =time
			datastyle[k].style['colValue'] = time
			datastyle[k].style.ismodified = true
			
		}else if( datastyle[k].style.value!=''){
			datastyle[k].style.ismodified = true
			if((datastyle[k].style.editStyle == 'ddlb' || datastyle[k].style.editStyle == 'radiobuttons') ) {
				var codeTable = JSON.parse(JSON.stringify(datastyle[k].style.codeTable)) 
				var initial = datastyle[k].style.value
				codeTable.forEach((val) => {
					if(initial === val.dataValue){
						datastyle[k].style['coldisplay'] = val.displayValue
						datastyle[k].style['colValue'] = val.dataValue
					}
				})
				if(datastyle[k].style.coldisplay == undefined){
					datastyle[k].style['coldisplay'] = '请选择'
					datastyle[k].style['colValue'] = ''
				}
			}else if(datastyle[k].style.editStyle=='dddw' &&datastyle[k].style.dddw.name=='d_nvo_uipage_dwc'){
				var tag_dddwname = datastyle[k].style.tag_dddwName
				var initial = datastyle[k].style.value
				for(var i=0; i<DataObjectExtData.length;i++){
					if(DataObjectExtData[i].dataobjectname == tag_dddwname && DataObjectExtData[i].coldata == initial){
						datastyle[k].style['value'] = DataObjectExtData[i].coldata
						datastyle[k].style['coldisplay'] = DataObjectExtData[i].coldisplay
						datastyle[k].style['colValue'] = DataObjectExtData[i].coldata
					}
					if(DataObjectExtData[i].dataobjectname == tag_dddwname){
						customlist.push(DataObjectExtData[i])
						datastyle[k].style['codeTable'] = customlist
					}
				}
			}
			else if(datastyle[k].style.editStyle=='dddw' &&datastyle[k].style.dddw.name!='d_nvo_uipage_dwc'){
				
				var isneedtrans = datastyle[k].style.isneedtrans==undefined?false:datastyle[k].style.isneedtrans
				if(isneedtrans){
				var productCode = uni.getStorageSync('productCode')
				var sessionId = uni.getStorageSync('sessionId')
				var projectCode = uni.getStorageSync('projectCode')
				var terminaltype = uni.getStorageSync('terminaltype')
				var dbId = uni.getStorageSync('dbId')
				var userId = uni.getStorageSync('userId')
				var userName = uni.getStorageSync('userName')
				var childDataObject = datastyle[k].style.dddw.name
				var displayColumn = datastyle[k].style.dddw.displayColumn
				var colName = datastyle[k].name
				var colValue = datastyle[k].style.value
				var injson = that.$requestPageDivChildStyle(options, divArea, childDataObject, colName)
				var url = getApp().globalData.app_address + '?method=saas_PageDivChildStyle&parse=json'
				const { data: result } = await that.$post2(url, injson);
				var pageConditions = {'pageNumber':1,'rowsPerPage':20,'isAllData':true}
				var filterConditions = []
				var conditions = []
				// var filterobj = {}
				// filterobj['column'] = colName
				// filterobj['value'] = colValue
				// conditions.push(filterobj)
				var injson2 = that.$requestPageDivChildData(options, divArea, childDataObject, colName, filterConditions,JSON.stringify(conditions),'{}',pageConditions)
				console.log(injson2)
				var url2 = getApp().globalData.app_address + '?method=saas_PageDivChildData&parse=json'
				const { data: result2 } = await that.$post2(url2, injson2);
				console.log('result2',result2)
				var datalisttemp = result2.data.div.value
				datalisttemp.forEach((dval,dindex)=>{
					if(dval[colName] == colValue){
						datastyle[k].style['coldisplay'] = dval[displayColumn]
						datastyle[k].style['colValue'] = colValue
					}
				})
				}
			}
			else{
				datastyle[k].style['value'] = datastyle[k].style.value
				datastyle[k].style['coldisplay'] = datastyle[k].style.value
				datastyle[k].style['colValue'] = datastyle[k].style.value
			}
		
		}
	}
	return datastyle
}

function getcommimenu(commitArr,div, dataList, olddatalist){
	var commitobj = {}
	commitobj['divArea'] =div.name
	commitobj['dataObject'] = div.style.dataObject
	var tempdataList = JSON.parse(JSON.stringify(dataList))
	var tempoldatalist = JSON.parse(JSON.stringify(olddatalist))
	var dataArr = []
	
	if(JSON.stringify(olddatalist) != '[]' && JSON.stringify(dataList) != '[]'){
		if(dataList.length == olddatalist.length){
			for(var m=0; m<olddatalist.length; m++){
				if(olddatalist[m].menuid != dataList[m].menuid && dataList[m].optype === ''){
					dataList[m].optype = 'update'
				} 
			}
		}else if(dataList.length > olddatalist.length){
			var n = olddatalist.length
			for(var m=0; m<dataList.length; m++){
				if(m >= n && dataList[m].optype === ''){
					dataList[m].optype = 'update'
				}
				if(m < n){
					if(olddatalist[m].menuid != dataList[m].menuid && dataList[m].optype === ''){
						dataList[m].optype = 'update'
					} 
				}
			}
		}else if(dataList.length < olddatalist.length){
			var n = dataList.length
			for(var m=0; m<olddatalist.length; m++){
				if(m < n){
					if(olddatalist[m].menuid != dataList[m].menuid && dataList[m].optype === ''){
						dataList[m].optype = 'update'
					} 
				}
			}
		}
		var isdelete = true
		
		for(var o=0; o<olddatalist.length; o++){
			for(var p=0; p<tempdataList.length; p++){
				if(olddatalist[o].menuid == tempdataList[p].menuid){
					isdelete = false
				}
			}
			if(isdelete){
				olddatalist[o].optype = 'delete'
				dataList.push(olddatalist[o])
			}
			
			isdelete = true
		}
	}
	
	if(JSON.stringify(olddatalist) != '[]' && JSON.stringify(dataList) =='[]'){
		for(var m=0; m<olddatalist.length; m++){
			olddatalist[m].optype = 'delete'
			dataList.push(olddatalist[m])
		}
	}
	
	dataList.forEach((val)=>{
		if(val.optype == 'insert'){
			tempoldatalist.forEach((val2)=>{
				if(val.menuid == val2.menuid){
					val.optype = ''
				}
			})
		}
	})
	
	console.log(JSON.parse(JSON.stringify(dataList)) )
	var log = {}
	
	for(var k=0;k<dataList.length;k++){
		var datadata = {}
		var conditions = {}
		if(dataList[k].optype === ''){
			continue
		}else if(dataList[k].optype == 'insert'){
			datadata = dataList[k]
		}else{
			if(dataList[k].optype != 'delete'){
				datadata['sortid'] = k
			}
			conditions['menuid'] = dataList[k].menuid
			conditions['projectcode'] = uni.getStorageSync('projectCode')
			conditions['terminaltype'] = uni.getStorageSync('terminaltype')
			conditions['userid'] = uni.getStorageSync('userId')
			conditions['position'] = dataList[k].position
		}
		var objobj = {}
		var dataobj = {}
		dataobj['row'] = 1
		dataobj['type'] = dataList[k].optype
		dataobj['data'] = datadata
		dataobj['conditions'] = conditions
		dataArr.push(dataobj)
	}
	console.log(JSON.parse(JSON.stringify(dataArr)))
	commitobj['dataArr'] = dataArr
	commitArr.push(commitobj)
	
	return commitArr
}

function getlistArg(expArgs,divstyle,datalist,conditions){
	if(JSON.stringify(expArgs) != '[]'){
		if(JSON.stringify(divstyle) == '{}'){
			
			for(var i=0; i<expArgs.length; i++){
				var colName = expArgs[i].colName
				for(var j=0; j<datalist.length; j++){
					if(datalist[j].name == colName){
						expArgs[i]['value'] = datalist[j].style.value
					}
				}
				var divArea = expArgs[i].divArea
				if(divArea == 'pageArgs'){
					expArgs[i]['value'] = conditions.dw_datalist[colName]
				}
			}
		}else{
			console.log(JSON.parse(JSON.stringify(datalist)))
			for(var i=0; i<expArgs.length; i++){
				var colName = expArgs[i].colName
				for(var j=0; j<datalist.length; j++){
					var content = datalist[j].content==undefined?datalist[j].data:datalist[j].content
					for(var k=0; k<content.length; k++){
						if(content[k].name == colName){
							expArgs[i]['value'] = content[k].style.colValue
						}
					}
				}
				var divArea = expArgs[i].divArea
				if(divArea == 'pageArgs'){
					expArgs[i]['value'] = conditions.dw_datalist[colName]
				}
			}
		}
	}
	return expArgs
}

function getlistCon(expArgs,divstyle,datalist,conditions){
	if(JSON.stringify(expArgs) != '[]'){
		if(JSON.stringify(divstyle) == '{}'){
			for(var i=0; i<expArgs.length; i++){
				var colName = expArgs[i].colName
				for(var j=0; j<datalist.length; j++){
					if(datalist[j].name == colName){
						conditions[colName] = datalist[j].style.value
					}
				}
			}
		}else{
			expArgs.forEach((val)=>{
				var colName = val.colName
				for(var j=0; j<datalist.length; j++){
					var content = datalist[j].content==undefined?datalist[j].data:datalist[j].content
					for(var k=0; k<content.length; k++){
						if(content[k].name == colName){
							conditions[colName] = content[k].style.colValue
						}
					}
				}
			})
		}
		
	}
	return conditions
}


module.exports = {
  convertstyletoinfo,
  constructheadlist,
  post2,
  getcommitobj,
  getcommitobj2,
  calculateExpression,
  strtoexp,
  divblocktrans,
  billaddinitaldatastyle,
  getcommimenu,
  getlistCon,
  getlistArg
};